﻿using System;
using System.Collections.Generic;

using E.BLL;
using E.Model;
using E.Web.UI.Page;

using X.Common;


namespace E.Web.training.internals.publics.classes
{
    public partial class SignUp : BasePage
    {
        protected override void ShowPage()
        {
            if (ispost)
            {
                int classid = XRequest.GetInt("classid", -1);
                int courseid = XRequest.GetInt("courseid", -1);
                int projectid = XRequest.GetInt("projectid", -1);
                if (classid != -1 && courseid != -1 && projectid != -1)
                {
                    int rst = (new ClassBLL()).SignUpInternalPublic(userid, classid, courseid, projectid);
                    if (rst > 0)
                    {
                        ExecuteJS("alert('报名成功'); history.back();");
                    }
                    else
                    {
                        ExecuteJS("alert('报名失败或已报过该项目'); history.back();");
                    }
                }
                else
                {
                    ExecuteJS("alert('参数错误'); history.back();");
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
